package com.zr.bookcorner.fragment;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.zh.baselibrary.base.BaseFragment;
import com.zh.baselibrary.base.BasePresenter;
import com.zh.model.manager.BookInfo;
import com.zr.bookcorner.BookApplication;
import com.zr.bookcorner.R;
import com.zr.bookcorner.adapter.BorrowReturnDetailAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class BorrowReturnDetailFragment extends BaseFragment {

    @BindView(R.id.rv_book)
    RecyclerView mRvBook;
    private BorrowReturnDetailAdapter mAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.borrow_return_detail_fragment;
    }

    @Override
    protected void init() {
        mAdapter = new BorrowReturnDetailAdapter(new ArrayList<>());
        mRvBook.setLayoutManager(new GridLayoutManager(getActivity(), BookApplication.isBig() ? 5 : 3));
        mRvBook.setAdapter(mAdapter);
    }
    public void setDatas(List<BookInfo> list) {
        if (mAdapter != null) {
            mAdapter.clearAdd(list);
        }
    }
    @Override
    protected BasePresenter createPresenter() {
        return null;
    }
}
